<header data-am-widget="header" class="am-header am-header-default sq-head ">
	<div class="am-header-left am-header-nav">
		<a href="javascript:history.back()" class="">
			<i class="am-icon-chevron-left"></i>
		</a>
	</div>
	<h1 class="am-header-title">
		<a href="" class="">个人资料</a>
	</h1>
</header>
<div style="height: 49px;"></div>
<form action="" class="layui-form">
	<ul class="safty1">
		<li>
				<i style="margin-top: 25px;">头像</i>
				<div class="infor-pic">
					<img src="__ROOT__/{:session('face')}"/>
				</div>
		</li>
		<li>
			<i>昵称</i>
			<input class="infor-tele" style="margin-left: 20px;line-height: 24px;color: #000000;background: #F6F6F6" value="{:session('username')}" placeholder="你即将使用的昵称" ></input>
		</li>
		<li>
			<i style="line-height: 35px">性别</i>
			<i class="infor-tele">
					<input type="radio" name="sex" value="0" {:$sex.sex==0 ? 'checked' : '' } data-am-ucheck>男
					<input type="radio" name="sex" value="1"  {:$sex.sex==1 ? 'checked' : '' } data-am-ucheck>女
			</i>
		</li>
	</ul>
	<div style="height: 10px; background: #efefef;"></div>
	<ul class="safty1">
		<li>
			<i>学校</i>
			<input class="infor-tele" style="height: 25px;color: #000000;background: #F6F6F6" name="school" value="{:$sex.school ? $sex.school :''}" placeholder="就读于哪个学校"/>
		</li>
		<li>
			<i>位置</i>
			<input class="infor-tele" style="height: 25px;color: #000000;background: #F6F6F6" name="address" value="{:$sex.address ? $sex.address :''}" placeholder="详细地址"/>
		</li>
		<li>
			<i>手机</i>
			<input class="infor-tele" style="margin-left: 20px;line-height: 24px;color: #000000;background: #F6F6F6" value="{:session('phone')}" placeholder="你的手机号码" ></input>
		</li>
	</ul>
	<button class="layui-btn layui-btn-warm" lay-submit lay-filter="edit" style="float: right">保存</button>
</form>
<script>
    //Demo
    layui.use('form', function(){
        var form = layui.form;
        //监听提交
        form.on('submit(edit)', function(data){
           $.post("{:url('index/Edit/edits')}", data.field, function(res) {
               if (res.code==1){
                   layer.alert(res.msg, {icon: 1},function (){
                       location.reload();
				   });
               }else{
                   layer.msg(res.msg, {icon: 9},function () {});
               }
           });
            return false;
        });
    });
</script>
